package com.java46.struts2.admin.dao;

import com.java46.struts2.base.util.HibernateUtils;
import org.hibernate.query.Query;

import java.util.List;

/**
 * @ClassName AdminDao
 * @Description TODO
 * @Author Administrator
 * @Date 2018/7/22 0022 19:48
 * @Vcrsion 1.0
 **/
public class AdminDao {

   /**
    * @Author xiaobo
    * @Description //查询管理员
    * @Date 19:55 2018/7/22 0022
    * @Param [name, pwd]
    * @return java.util.List
    */
    public static List queryAdmin(String name,String pwd){
        String hql="";
        Query query=null;

            hql="from TAdminEntity ae where ae.adminName=?1 and ae.adminPwd=?2";
            query=HibernateUtils.getQuery(hql);
            query.setParameter(1,name);
            query.setParameter(2,pwd);
        List list = query.list();
        return list;
    }
}
